{# What the cloud account already runs and costs (overseer_deploy_form.account_panel, deploy_spend): what its servers cost a month and this month's spend where the provider says (or the token scope it needs to); on Cloud accounts the servers themselves (dearest first, aegis's own marked: nothing is being bought), on the steps the total with the server being bought. Loading, it asks again until the deploy agent has looked. #} {% from "components/macros/table.html" import data_table %} {% from "components/macros/layout.html" import avatar %} {% from "pages/overseer/deployments/_macros.html" import panel %} {% macro server_cell(server) -%} {{ server.name }}{% if server.project %} aegis: {{ server.project }}{% endif %} {%- endmacro %} {% call panel("account", f, "Asking " ~ f.name ~ " what is already running…", "Could not see what is running: ") %} {# The Overview marks each account by its logo; on the steps the cloud picker above already wears it. #}

{% if f.with is none %}{{ avatar(f.name, f.logo) }}{{ f.name }}:{% else %}Already in your account:{% endif %} {% if f.servers %}{{ f.servers|length }} server{{ "s" if f.servers|length != 1 }}, {{ f.running|money(f.currency) }} a month{% else %}nothing running{% endif %}. {% if f.with is not none %}With this one: {{ f.with|money(f.currency) }} a month.{% endif %}

{% if f.month_to_date is not none %}

Spent so far this month: {{ f.month_to_date|money(f.currency) }}, everything in the account, not only servers.

{% endif %} {% for scope in f.missing %}

To see this month's spend too, give the token {{ scope }}.

{% endfor %} {% if f.servers and f.with is none %} {{ data_table([ {"key": "server", "label": "Server", "render": server_cell}, {"key": "size", "label": "Size"}, {"key": "region", "label": "Region"}, {"key": "price", "label": "A month", "kind": "money", "align": "right"}, {"key": "age", "label": "Created", "align": "right"}, ], f.servers, flush=False) }} {% endif %} {% endcall %}